package org.mattmckay.PDFd.Layer;

import PDFd.Layer.Point;

import junit.framework.TestCase;

public class PointTest extends TestCase {
	Point one = new Point(7,10);
	Point two = new Point(2,2);
	Point expectedDifference = new Point(5,8);
	float scaleFactor = (float) 0.5;
	Point expectedScale = new Point(14,20);

	protected void setUp() throws Exception {
		super.setUp();
	}
	
	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public final void testDifferencePoint() {
		assertEquals(two.difference(one),expectedDifference);
	}
	public final void testDistancePoint() {
		assertEquals(two.distance(one),9.433981132056603,.1e-10);
	}

	public final void testDifferenceIntInt() {
		assertEquals(two.difference(one.x,one.y),expectedDifference);
	}

	public final void testScale() {
		assertEquals(expectedScale,one.scale(scaleFactor));
	}

}
